package gui;

import javax.swing.JPanel;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JComboBox;

public class AppPanelAuthorSettings extends JPanel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3532086094480804100L;
	public static JButton btnCharCreate = new JButton("Create");
	public static JButton btnCharDelete = new JButton("Delete");
	public static JButton btnCharEdit = new JButton("Save");
	public static JTextField txtName = new JTextField();
	public static JTextField txtNickname = new JTextField();
	public static JTextField txtFirstname = new JTextField();
	public static JScrollPane scrollPane = new JScrollPane();
	public static JTextArea taCharDesc = new JTextArea();
	public static JComboBox dropCharFaction = new JComboBox();
	public static JComboBox dropCharLevel = new JComboBox();
	public static JComboBox dropCharRole = new JComboBox();
	public static JButton btnCharImage = new JButton("Select Image");
	public static JTextField txtImageUrl = new JTextField();
	public static JTextField txtCharAge = new JTextField();
	public static JLabel lblCharAge = new JLabel("Age");
	public static JLabel lblCharRole = new JLabel("Role");
	public static JLabel lblCharLevel = new JLabel("Level");
	public static JLabel lblCharFaction = new JLabel("Faction");
	public static JComboBox dropGender = new JComboBox();
	private final JLabel lblGender = new JLabel("Gender");
	private final JLabel lblName = new JLabel("Character Name");
	private final JLabel lblNickname = new JLabel("Nickname");
	private final JLabel lblFirstname = new JLabel("Firstname");
	
	
	
	/**
	 * Create the panel.
	 */
	public AppPanelAuthorSettings() {
		txtFirstname.setText("FirstName");
		txtFirstname.setColumns(10);
		txtName.setText("Name");
		txtName.setColumns(10);
		setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("75px"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("100px:grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("100px:grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("100px:grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		add(lblName, "4, 2");
		
		add(lblNickname, "6, 2");
		
		add(lblFirstname, "8, 2");
		add(btnCharEdit, "2, 4");
		
		add(txtName, "4, 4, fill, default");
		txtNickname.setText("Nickname");
		txtNickname.setColumns(10);
		
		add(txtNickname, "6, 4, fill, default");
		
		add(txtFirstname, "8, 4, fill, default");
		add(btnCharDelete, "2, 6");
		
		add(scrollPane, "4, 6, 5, 5, fill, fill");
		taCharDesc.setText("the description of your character");
		
		scrollPane.setViewportView(taCharDesc);
		add(btnCharCreate, "2, 8");
		
		add(lblGender, "4, 12");
		
		add(dropGender, "4, 14, fill, default");
		
		add(lblCharAge, "6, 14, right, default");
		txtCharAge.setText("Age");
		txtCharAge.setColumns(10);
		
		add(txtCharAge, "8, 14, fill, default");
		
		add(lblCharRole, "4, 16");
		
		add(lblCharLevel, "6, 16");
		
		add(lblCharFaction, "8, 16");
		
		add(dropCharRole, "4, 18, fill, default");
		
		add(dropCharLevel, "6, 18, fill, default");
		
		add(dropCharFaction, "8, 18, fill, default");
		txtImageUrl.setText("URL or File");
		txtImageUrl.setColumns(10);
		
		add(txtImageUrl, "4, 20, 3, 1, fill, default");
		
		add(btnCharImage, "8, 20");
	}

}
